package com.jwxt;

import java.util.Optional;
import java.util.List;

public class Stu {

    public static Integer page = 1;
    public static Integer limit = 10;


    /**
     * 获取学生信息总数
     *
     * @return 学生信息总数
     */
    public static Integer getTotal() {
        String sql = "select count(*) as total from student";
        List<List<String>> list_total = DatabaseQuery.query(sql);
        if (list_total != null) {
            return Integer.parseInt(list_total.get(0).get(0));
        }
        return 0;
    }

    /**
     * 获取学生信息
     *
     * @return 学生信息
     */
    public static List<List<String>> getStuList() {
        String sql = "select * from student limit " + (page - 1) * limit + "," + limit + ";";
        return DatabaseQuery.query(sql);
    }



}
